<?php
	require '../modelo/comentar.php';
	$obj = new comentar();
	$datos = $obj->all();
?>
<html lang='es'>
<head>
	<title>Modificar Registro</title>
	<meta charset='UTF-8'>
	<link rel="stylesheet" type="text/css" href="css/modificar.css">
</head>
<body>
	<div id="formulario">
<form action="../controlador/valida_mod.php" method="post" name="form">
			<br>	
			<center>
			<label for="id"><strong>Id</strong></label><br>
			<input class='largo' type="int" name="id_cm" required autofocus><br><br>

			<label for="nombre"><strong>Nombre</strong></label><br>
			<input class='largo' type='text' name='nombre_cm' placeholder="Escribe tu nombre" required><br><br>

			<label for="apellidoMaterno"><strong>Fecha del Comentario</strong></label></br>
			<input class='largo' type='date' name='fecha_cm' placeholder="Fecha" required></br><br>

			<label for="correo"><strong>E-mail</strong></label></br>
			<input class='largo' type='text' name='correo_cm' placeholder="Escribe tu e-mail" required></br><br>

			<label for="comentario"><strong>Comentarios</strong></label></br>
			<textarea class='ancho' type='text' name='comentarios_cm' placeholder="Escribe tus comentarios" required></textarea>
			</br>

			<input class='boton' type='submit' name='GUARDAR' value='GUARDAR' title='GUARDAR'>
			</center>
		</form>	
	</div>
	<div id="base">
		<?php if(sizeof ($datos) >0): ?>
	<center>
	<table border='10'>
		<tr>
			<th>N° CLIENTE</th>
			<th>NOMBRE</th>
			<th>FECHA</th>
			<th>CORREO</th>
			<th>COMENTARIO</th>	
			<th>IMAGEN</th>		
		</tr>
	<?php foreach ($datos as $row): ?>
		<tr>
			<td align="center">
				<?php echo $row ['id_cm']; ?>
			</td>
			<td>
				<?php echo $row ['nombre_cm']; ?>
			</td>

			<td>
				<?php echo $row ['fecha_cm']; ?>
			</td>

			<td>
				<?php echo $row ['correo_cm']; ?>
			</td>

			<td>
				<?php echo $row ['comentarios_cm']; ?>
			</td>

			<td>
				<?php echo $row ['imagen_cm']; ?>
			</td>
		</tr>

		<?php endforeach; ?>
		
	</table>
<?php endif; ?>
</center>
	</div>
</body>
</html>